openFile(myfile, the applicationPath & the WhichFile of me, 0)
set theFile to readFile(myfile)
put theFile into field the WhichField of me
"Write to File from Field":
openFile(myfile, the applicationPath & the WhichFile of me, 0)
delete(myfile)
createFile(myfile, the applicationPath & the WhichFile of me)
openFile(myfile, the applicationPath & the WhichFile of me, 0)
setFinderInfo(myfile, "TEXT ttxt")
writeString(myfile, the text of member the WhichField of me)
"Delete File":
openFile(myfile, the applicationPath & the WhichFile of me, 0)
delete(myfile)
end case
closeFile(myfile)
set myfile to 0
end
on getPropertyDescriptionList
set p_list to [#whichevent: [#comment: "Initializing Event:", #format: #symbol, #range: [#mouseUp, #mouseDown, #prepareFrame, #enterFrame, #exitFrame], #default: #mouseUp], #ReadOrWrite: [#comment: "Function:", #format: #string, #default: "Read", #range: ["Read from File into Field", "Write to File from Field", "Delete File"]], #WhichFile: [#comment: "Filename:", #format: #string, #default: ".txt"], #WhichField: [#comment: "Field Name", #format: #field, #default: member 1]]
return p_list
end
on getBehaviorDescription
return "This behavior will:" & RETURN & "*** Read a file into a field" & RETURN & "*** Write a field to a file" & RETURN & "*** Delete a file" & RETURN & "This behavior assumes that file is " & RETURN & "located in the same folder as the projector/Director"